<?php
class SQLException extends Exception{
	private $error;
	private $dbtype;
	private $query;
	
	public function __construct($sqlerror, $dbtype, $query = null){
		parent::__construct("An SQL error have ocurred: " . $sqlerror);
		
		$this->setError($sqlerror);
		$this->setDatabaseType($dbtype);
		$this->setQuery($query);
	}
	
	private function setError($error){
		$this->error = $error;
	}
	
	private function setDatabaseType($dbtype){
		$this->dbtype = $dbtype;
	}

	private function setQuery($query){
		$this->query = $query;
	}
	
	public function getError(){
		return $this->error;
	}
	
	public function getDatabaseType(){
		return $this->dbtype;
	}
	
	public function getQuery(){
		return $this->query;
	}
}
?>